﻿namespace KeppelLand.Services
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Threading;
    //using WebBackgrounder;

    /// <summary>
    /// Summary description for TestTimer
    /// </summary>
    //[assembly: WebActivator.PreApplicationStartMethod(typeof(SampleAspNetTimer), "Start")]
    public class TestTimer
    {
        public TestTimer()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        private static readonly Timer _timer = new Timer(OnTimerElapsed);
        private static readonly RecurringJobHost _jobHost = new RecurringJobHost();

        public static void Start()
        {
            _timer.Change(TimeSpan.Zero, TimeSpan.FromMilliseconds(1000));
        }

        private static void OnTimerElapsed(object sender)
        {
            _jobHost.DoWork(() => { /* What is it that you do around here */ });
        }
    }

}